package main

import (
	"camp_lucky_draw/client/client_service"
	"fmt"
)

/**
* @author aFun
* @data 2025/4/12 12:33
* @email: afunaaa222@163.com / 1030935903
* @address: Guangdong University of Technology, China
 */

func main() {
	up := &client_service.UserProcess{}
	var key int
	var loop = true
	for loop {
		fmt.Println("Welcome to aFun's lucky Draw!")
		fmt.Println("\t\t\t 1 login")
		fmt.Println("\t\t\t 2 exit")
		fmt.Print("Please input:")
		fmt.Scanf("%d\n", &key)
		switch key {
		case 1:
			var UserId uint
			fmt.Println("Input UserId:")
			fmt.Scanf("%d\n", &UserId)
			err := up.Enter_world(UserId, true)
			if err != nil {
				fmt.Println(err)
			}
		case 2:
			fmt.Println("exit...")
			loop = false
		default:
			fmt.Println("Invalid input...")
		}
	}
	// 记得主动关闭
	defer client_service.CurUser.Conn.Close()
	// 主线程阻塞神器！
	select {}
}
